Scalable vector graphics (SVG) is a vector image format for two-dimensional graphics that supports interactivity and animation. Extensible markup language (XML) text files define the behavior of objects in the scalable vector graphics images. Unlike a raster image, which is composed of a fixed set of pixels, a vector image is composed of a fixed set of shapes. The objects are rendered based on the SVG definition in the text files.
A user interface thread may interact with a rendering thread to render the SVG objects. The user interface thread may receive an event from a script for an SVG object and calculate parameters for rendering the SVG object, such as the positioning, color, layout, and other characteristics. The user interface thread then passes the parameters for the SVG object to the rendering thread, which can render the SVG object along with any other SVG objects in the user interface. While the rendering thread is rendering the SVG object, the user interface thread is blocked from performing any other computations. When the rendering thread finishes rendering the SVG object, the user interface thread can begin performing any computations. By blocking the user interface thread, the user interface thread may miss some events from the script that need to be processed. Further, the amount of time the user interface thread is active is reduced by the amount of time the rendering thread takes to render the SVG objects. This is an inefficient use of the user interface thread. For example, the time the user interface thread has to perform computations may be reduced by half or more due to the blocking.